<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!-- <meta http-equiv="Refresh" content="1" /> -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>index</title>

</head>

<body>
    <div style="margin-left: 130px;font-size: 18px;">
        <h1>F12查看效果</h1>
        <h2>1.字符串前补位0</h2>
        <div id="damo1"></div>
        <h2>2.获取当前时间</h2>
        <div id="damo2"></div>
        <h2>3.日期格式化</h2>
        <div id="damo3"></div>
        <h2>4.随机颜色</h2>
        <div id="damo4"></div>
        <h2>5.浏览器内核判断</h2>
        <div id="damo5"></div>
        <h2>6.PC 移动判断</h2>
        <div id="damo6"></div>
        <h2>7.判断是否是微信浏览器</h2>
        <div id="damo7"></div>
        <h2>8.版本兼容获取css属性</h2>
        <div id="damo8"></div>
        <br>
        <br>
        <br>
    </div>


</body>

</html>
<script src="./utils.js"></script>

<script>
    var result1 = zeroize(2)
    document.querySelector('#damo1').innerText = 'zeroize(2)//' + result1

    var result2 = ''
    result2 += "format('YmdHis')//" + format('YmdHis') + '<br>'//20220414173002
    result2 += "format('Y-m-d H:i:s')//" + format('Y-m-d H:i:s') + '<br>'//2022-04-14 17:30:02
    result2 += "format('Y-m-d')//" + format('Y-m-d') + '<br>'//2022-04-14 
    document.querySelector('#damo2').innerHTML = result2

    var result3 = ''
    result3 += "formatTime('Y-m-d H:i:s')//刚刚" + '<br>'
    result3 += "formatTime('Y-m-d H:i:s')//几分钟前" + '<br>'
    result3 += "formatTime('Y-m-d H:i:s')//几小时前" + '<br>'
    document.querySelector('#damo3').innerHTML = result3

    var result4 = 'randomColor()' + '//随机生成的颜色 '
    document.querySelector('#damo4').innerHTML = result4

    var result5 = 'edition()' + '//浏览器内核判断 '
    document.querySelector('#damo5').innerHTML = result5

    var result6 = 'mobile()' + '//PC端、移动端判断 '
    document.querySelector('#damo6').innerHTML = result6

    var result7 = 'weixin()' + '//是否是微信浏览器判断 '
    document.querySelector('#damo7').innerHTML = result7

    var result8 = "//(tagObj=>document.querySelector('标签对象')、cssAttr=>css属性)" + '<br>' + 'getStyle(tagObj, cssAttr)' + '//版本兼容获取css行内样式外属性值'
    document.querySelector('#damo8').innerHTML = result8

</script>